package com.demo.morning;

/**
 * @ClassName excerise
 * @Description TODO
 * @Author tianqinglong
 * @Date 10:14 2022/7/6
 * @Version 1.0
 **/
public class excerise {
    public static void main(String[] args) {
        Teacher t1 = new Teacher() {
            @Override
            public int teach() {
                return 20;
            }
        };
        Teacher t2 = new Teacher() {
            @Override
            public int teach() {
                return 30;
            }
        };
        System.out.println(t1.teach());
        System.out.println(t2.teach());
    }
}

interface Teacher {
    default int teach() {
        System.out.println("教师教书");
        return 10;
    }
}